<?php
class MyTag extends CWidget{
	public $user;//用户表的一条记录
	public $type = 'search';//是用户页面还是搜索页面
	public function init(){
		$tag = $this->user->news_tag_name;
		$userId = $this->user->user_id;
		$mytag = NC::string2array($tag);
		echo '<ul class="tag_list">';
		foreach($mytag as $val){
			if($this->type == "user")
				$linkPrefix = "/tag/$userId";
			else
				$linkPrefix = '/tag';
			echo "<li class='tag_li'><span class='one_logo'></span><a href='$linkPrefix/".CHtml::encode($val)."' class='tag'>".$val."</a></li>";
		}
		echo '</ul>';
		parent::init();
	}
}